package com.kun.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.activiti.api.task.model.Task;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Getter
@Setter
@ToString
@NoArgsConstructor
public class TaskVo {

    /**
     * 任务ID
     */
    @NotBlank(message = "任务ID不能为空")
    private String id;

    /**
     * 执行人，但是如果为空表示待拾取的任务
     */
    private String assignee;

    /**
     * 任务名称
     */
    private String name;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdDate;

    /**
     * 流程实例的名称
     */
    private String instanceName;


    /**
     * 任务状态
     */
    private Task.TaskStatus status;

    public TaskVo(String id, String assignee, String name, Date createdDate, String instanceName, Task.TaskStatus status) {
        this.id = id;
        this.assignee = assignee;
        this.name = name;
        this.createdDate = createdDate;
        this.instanceName = instanceName;
        this.status = status;
    }
}
